﻿using RealtReview.DataAccess.Entities;
using RealtyReview.Business.Models.ViewModels;

namespace RealtyReview.Business.Mappings
{
    public class NewsMappings
    {
        public News ToNews(NewsViewModel model)
        {
            return new News
            {
                Title = model.Title,
                Description = model.Description
            };
        }

        public NewsViewModel ToNewsViewModel(News entity)
        {
            return new NewsViewModel
            {
                Description = entity.Description,
                Title = entity.Title,
                NewsId = entity.Id
            };
        }
    }
}
